// 变量管理相关接口

import services, { servicesSmp } from '../createServices';

// 事件监控
export const eventMonitor = {
  list: (params) => servicesSmp.post('/strategy-record/list', { params, isLoading: true }),
  createCase: (params) => services.post('/event-monitor/create-case', { params, isLoading: true }),
  queryOne: (params) => servicesSmp.post('/strategy-record/detail', { params, isLoading: true }),
  selectFields: (params) => services.post('/event-monitor/select-fields', { params, isLoading: true }),
  handleData: (params) => services.post('/event-monitor/handle-data', { params, isLoading: true }),
  download: (params) => services.post('/event-monitor/bulk-download', { params, isLoading: true }),
  getDownload: (params) => services.post('/event-monitor/get-download', { params, isLoading: true })
};

// 设备监控
export const deviceMonitor = {
  list: (params) => services.post('/device-monitor/list', { params, isLoading: true }),
};

// 风险监控
export const riskMonitor = {
  add: (params) => services.post('/monitor/create', { params, isLoading: true }),
  update: (params) => services.post('/monitor/edit', { params, isLoading: true }),
  delete: (params) => services.post('/monitor/delete', { params, isLoading: true }),
  list: (params) => services.post('/monitor/list', { params, isLoading: true }),
  switchStatus: (params) => services.post('/monitor/is-used', { params, isLoading: true }),
  allStrategy: (params) => services.post('/strategy-production/all', { params, isLoading: true }),
  allVersion: (params) => services.post('/strategy-production/all-version', { params, isLoading: true }),
  allRule: (params) => services.post('/monitor/all-rule', { params, isLoading: true }),
  warnList: (params) => services.post('/monitor/send-list', { params, isLoading: true })
};

// 数据报告管理
export const dataReport = {
  add: (params) => services.post('/data-report/create', { params, isLoading: true }),
  update: (params) => services.post('/data-report/edit', { params, isLoading: true }),
  delete: (params) => services.post('/data-report/delete', { params, isLoading: true }),
  list: (params) => services.post('/data-report/list', { params, isLoading: true }),
  switchStatus: (params) => services.post('/data-report/is-used', { params, isLoading: true }),
  searchUser: (params) => services.post('/data-report/search-user', { params }),
  receiveList: (params) => services.post('/data-report/receive-list', { params, isLoading: true }),
  sendList: (params) => services.post('/data-report/send-list', { params, isLoading: true }),
  searchWx: (params) => services.post('/monitor/get-wechat', { params })
};

// 运维监控
export const devOpt = {
  serverMonitor: (params) => services.post('/server-monitor/statistics', { params, isLoading: true }),
  serverList: (params) => services.post('/server-monitor/server-list', { params, isLoading: true }),
  middlewareMonitor: (params) => services.post('/middleware-monitor/statistics', { params, isLoading: true }),
  apiMonitor: (params) => services.post('/api-call-monitor/statistics', { params, isLoading: true }),
  nodesMonitor: (params) => services.post('/nodes-monitor/statistics', { params, isLoading: true }),
  // 节点状态列表
  nodeList: (params) => services.get('/middleware-monitor/nodes-list', { params, isLoading: true }),
  appList: (params) => services.post('/nodes-monitor/app-list', { params, isLoading: true }),
  warningMonitor: (params) => services.post('/warning-monitor/statistics', { params, isLoading: true }),
  warningMonitorDetail: (params) => services.post('/warning-monitor/detail', { params, isLoading: true }),
  warningMonitorVariables: (params) => services.post('/warning-monitor/variables', { params }),
  warningMonitorSettingGet: (params) => services.get('/warning-monitor/setting', { params, isLoading: true }),
  warningMonitorSetting: (params) => services.post('/warning-monitor/setting', { params, isLoading: true }),
};
